Release 10.1A: OpenEdge Development:
Basic Database Tools
Creating a trigger
There are two types of triggers: session and schema. You create session triggers as part of a Progress 4GL procedure and create schema triggers using the Data Dictionary. See OpenEdge Development: Progress 4GL Handbook for information about creating session triggers.
There are two types of schema triggers: table and field.
![]()
To create a table trigger:
- Choose Schema
Add New Table or choose Schema
Modify Table. If you are adding a new table, specify a table name. If you are modifying a table, the Data Dictionary alphabetically lists all the tables defined for your database. Select the table for which you want to create the trigger.
- Choose Triggers. The Table Triggers dialog box appears.
- Define the trigger attributes. For more information on the Table Triggers dialog box and the trigger attributes, see the "Table Triggers" section.
- Specify whether a session trigger can override this schema trigger. For more information about session and schema triggers, see the chapter on database triggers in OpenEdge Development: Progress 4GL Handbook .
- Specify whether the database engine checks the cyclical redundancy check (CRC) code for the trigger.
- Press PUT to enter the trigger code. The Data Dictionary displays the Trigger Code dialog box.
- Enter the trigger code.
- Choose OK to return to the Table Triggers dialog box.
- Choose OK to return to the Add Table or Modify Table window.
![]()
To create a field trigger from an existing field:
- Choose Schema
Field Editor. The Field Editor alphabetically lists all the tables defined for your database.
- Select the table that contains the field for which you want to create the trigger. The Field Editor window appears.
- Choose Triggers.
- Select the field for which you want to define the trigger. The Field Triggers dialog box appears:
![]()
- Specify the name of the trigger procedure, then press PUT to enter the trigger code. The Trigger Editor appears.
- Specify whether a session trigger can override the schema trigger. For more information about session and schema triggers, see the chapter on database triggers in the OpenEdge Development: Progress 4GL Handbook .
- Specify whether the database engine verifies the cyclical redundancy check (CRC) code.
Note: To generate r-code for schema trigger definitions, you must define the trigger procedure in the Data Dictionary tool, then compile and save the r-code with the Application Compiler.- Choose OK to create the trigger and return to the Field Editor.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |